﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using IterationLife.Extensions.Dtos;
using Util.Applications;

namespace IterationLife.PlatformBackEnd.AppServices.Dtos.ContentResources {
    /// <summary>
    /// 内容资源图集数据传输对象
    /// </summary>
    [DataContract]
    public class ContentResourcePictureDto : DtoBase {

        /// <summary>
        /// 初始化内容资源图集数据传输对象
        /// </summary>
        public ContentResourcePictureDto()
        {
            Picture = new Resources();
        }

        /// <summary>
        /// 内容资源编号
        /// </summary>
        [Display( Name = "内容资源编号" )]
        [DataMember]
        public Guid? ContentResourceId { get; set; }
        
        /// <summary>
        /// 图片
        /// </summary>
        [Required(ErrorMessage = "图片不能为空")]
        [Display( Name = "图片" )]
        [DataMember]
        public Resources Picture { get; set; }
        
        /// <summary>
        /// 说明
        /// </summary>
        [StringLength( 1000, ErrorMessage = "说明输入过长，不能超过1000位" )]
        [Display( Name = "说明" )]
        [DataMember]
        public string Explain { get; set; }
        
        /// <summary>
        /// 排序号
        /// </summary>
        [Display( Name = "排序号" )]
        [DataMember]
        public int? SortId { get; set; }
        
        /// <summary>
        /// 输出内容资源图集状态
        /// </summary>
        public override string ToString() {
            return this.ToEntity().ToString();
        }
    }
}
